<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ page isELIgnored="false"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>翼飞新零售商户平台</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--jqueryUI  -->
<script type="text/javascript" src="<%=basePath%>js/commons/common_edit.js"></script>
<script src="<%=basePath%>js/commons/bodycomm.js" type="text/javascript"></script>
<link href="<%=basePath%>css/en/home.css" rel="stylesheet" type="text/css">
<link href="<%=basePath%>css/en/sidenavtion.css" rel="stylesheet" type="text/css">
<style type="text/css"> 
	*{ 
		margin: 0px; 
		padding: 0px; 
	} 
	html, body{ 
		height: 100%; 
	} 
	body{ 
		font-size: 14px; 
		line-height: 24px; 
	} 
</style> 
</head>
<body>
<input type="hidden" name="locale" id="locale" value="zh_CN">
	<div class="layout">
		<div class="side">
			<div class="userinfo">
				<div class="username">翼飞新零售</div>
				<div id="userImgDiv" style="text-align: center;">
					<img id="loadUserImg" style="width:110px;height:110px;margin-top:30px;margin-bottom:30px;" src="images/mrtx.png" />
				</div>
				<div class="username"><s:property value="userInfo.FullName"/></div>
			</div>
			<div class="sidenavtionbox">
				<ul class="sidenavtion">
					<s:iterator var="mep" value="#request.moduleList" status="status">
						<s:if test="%{#mep.ModuleParent == 0}">
							<li title="<s:property value="#mep.ModuleName" />" id="pNav<s:property value="#status.count" />" >
								<a href="#" onClick="forward('<s:property value="#mep.ModuleAddress" />');return false">
									<img alt="" src="images/icon/sidemenu/3.png">
									<s:property value="#mep.ModuleName" />
								</a>
								<ul class="sub-menu" id="mNav<s:property value="#status.count" />">
									<s:iterator var="mec" value="#request.moduleList" status="status2">
										<s:if test="%{#mec.ModuleParent == #mep.ModuleId}">
											<li	onClick="forward('<s:property value="#mec.ModuleAddress" />');return false" title="<s:property value="#mec.ModuleName" />">
												<a href="#" > 
													<img alt="" src="images/icon/sidemenu/3.png">
													<s:property value="#mec.ModuleName" />
												</a>
											</li>
										</s:if>
									</s:iterator>
								</ul>
							</li>
						</s:if>
					</s:iterator>
				</ul>
			</div>
		</div>
		<div class="main">
			<!-- 顶部工具栏 -->
			<div class="topbar">
				<div class="topbarleft">
				<input class="hidectrl" name="Button3" type="button" value="">
				</div>
				<div class="topbarright">
					<ul>
						<li><a href="#"onclick="_modifyUser();return false;" style="color:#666">用户信息</a>
						</li>
						<li><a href="#"onclick="_updatePwd();return false;" style="color:#666">修改密码</a>
						</li>
						<li><a href="#"onclick="_logout();return false;" style="color:#666">退出</a>
						</li>
					</ul>
				</div>
			</div>
		<div class="home">
			<iframe src="<%=basePath%>/loginAction/home.action" id="mainFrame" align="top" name="mainFrame" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" style="background-color: #e8e8e8;overflow-x:hidden;overflow-y:hidden;min-height:100%;width:100%;"></iframe> 
		</div>
		</div>
	</div>
	<script type="text/javascript">
		//点击菜单后显示跳转
		function forward(obj){
			if(obj==""||obj==null){
				 return false;
			}else{
				$('html,body').animate({
		            'scrollTop': 0
		          }, 300);
				 mainFrame.location.href ="<%=basePath%>/"+obj;
			}
		}
		//logout
		function _logout(){
			top.window.location="<%=basePath%>/loginAction/logout.action";
		}
		//打开修改密码
		function _updatePwd(){
		    var _url = "<%=basePath%>user/toUpdatePwd.action";
		    	//调用art.dialog组件弹出窗口 采用iframe方式
		    	art.dialog.open(_url,
				{ 
				 	lock: true,//背景锁定
			    	background: '#BFBFBF', // 背景色
			    	opacity: 0.5,	// 透明度
					title : '修改密码',
					width: 600,
					height: 300,
					drag: false,//禁止拖动
					resize: false,//禁止改变大小
		    	}); 
		}
		function _modifyUser(){
		    var _url = "<%=basePath%>user/modifyHomeUser.action";
		    	//调用art.dialog组件弹出窗口 采用iframe方式
		    	art.dialog.open(_url,
				{ 
				 	lock: true,//背景锁定
			    	background: '#BFBFBF', // 背景色
			    	opacity: 0.5,	// 透明度
					title : '用户信息',
					width: 1000,
					height: 450,
					drag: false,//禁止拖动
					resize: false,//禁止改变大小
		    	}); 
		}
		//自动调整iframe框架的方法
		function iframeAuto(){ 
			try 
				{ 
					//定位需要调整的frame框架
					var a = document.getElementsByName("mainFrame"); 
					for(var i=0; i<a.length; i++)
					{ 
						var h = 0;
						$(window.frames["mainFrame"].document).find("._height").each(function(i){
					 		if($(this).offset().top>h){
					 		 	h = $(this).offset().top;
					 		}
						});
						var h1 = $(".side").css("height").replace("px","");
						var h2=Math.max(h1, h);      //取两者中的最大值
						//如果为首页
						a[i].style.height =  h2 +"px"; 
					} 
				} 
			catch (ex){} 
		} 
		window.setInterval(iframeAuto, 500); 
	</script>
</body>
</html>
